<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="gb2312">
    <title>Title</title>
    <style>
        .flex {
            display: flex;
            flex-direction: column;
            height: 100vh
        }

        .flex-item {
            flex: 1;
            overflow: auto;
        }

        .flex-body {
            flex: auto;
            overflow: auto;
        }
    </style>
</head>

<body>
    <div class="flex">
        <div class="flex-item">top</div>
        <div class="flex-body"></div>
        <div class="flex-item">bottom</div>
    </div>
</body>

</html>